//
//  WBTestViewController.m
//  仿微博
//
//  Created by RaoBo on 2018/12/23.
//  Copyright © 2018年 RB. All rights reserved.
//

#import "WBTestViewController.h"

@interface WBTestViewController ()

@end

@implementation WBTestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    //位移枚举
    NSArray *arr = @[@{@"name":@"jaldj"}];
    
    NSData *data = [NSJSONSerialization dataWithJSONObject:arr options:(NSJSONWritingPrettyPrinted | NSJSONWritingSortedKeys) error:nil];
    [data writeToFile:@"~/Desktop/test.json" options:(NSDataWritingWithoutOverwriting) error:nil];
    
    
    UIView *v = [[UIView alloc] init];
    v.autoresizingMask =  UIViewAutoresizingNone | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    
//            open class func data(withJSONObject obj: Any, options opt: JSONSerialization.WritingOptions = []) throws -> Data
    
//            open func write(toFile path: String, options writeOptionsMask: NSData.WritingOptions = []) throws
    
//    do {
//        let d =  try JSONSerialization.data(withJSONObject: array, options: [.prettyPrinted])
//        try (d as NSData).write(toFile: "/Users/raobo/Desktop/info.json", options:[.atomic])
//    } catch {
//
//    }
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
